<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<button>adsf</button>
</body>
</html>
<script type="text/javascript" src="js/jquery/jquery-1.11.3.min.js"></script>
<script>
    jQuery(document).ready(function ($) {
        $("button").click(function () {
            //var token=getCookie("token");
            //layer.msg(token);
            //示例
            $.ajax({
                headers: {
                    "token":"asd"//getCookie("token")
                },
                url: 'http://cn.pn.com/api-pn/user/user/v/findUserInfo',
                dataType: 'json',
                type: 'post',
                data: {userId:1},
                success: function (data) {
                    layer.msg(data.msg);
                },
                error: function (response) {
                    console.log(response);
                }
            });
          /* $.ajax({
                url: 'http://cn.pn.com/api-pn/user/test/p/test',
                dataType: 'json',
                type: 'post',
                data: {var1: 1},
                success: function (data) {
                    alert(data)
                },
                error: function (response) {
                    console.log(response);
                }
            });*/
        });
    });
</script>